This is the R code used to produce the map of the LOTVS database

The LOTVS (LOng-Term Vegetation Sampling) database is a collection of vegetation data using permanent plots worldwide. At present the database includes vegetation data from 80 study areas covering grasslands, shrublands and forest understory around the globe, with more than 8000 plots and data for ~4500 vascular plant species, sampled for at least 6 years (with a range of 6 to 53 mostly on yearly basis).

Following, the R code used to generate the map reported at the bottom of this page. The map shows the locations of the datasets included in LOTVS database.

Last update: 2021-04-14. The map will be regularly updated to add the locations of new databases.

Please, e-mail Francesco de Bello () or Marta Gaia Sperandii () for any inquiry about the database.

Please, e-mail Manuele Bazzichetto: for any issue or information about the map.

library(leaflet)
library(leaflet.esri)
library(leafem)
library(rmapshaper)
library(htmltools)
library(htmlwidgets)
library(sf)
#Load LOTVS points
LOTVS_pts <- read.csv(file = "D:/WorldEcologicalLandUnits/LOTVS/Trial.csv", header = T, dec = ",", sep = ";")
#Transform to spatial object - Pakeman5 falls in the water (near Scotland)
LOTVS_spatial <- st_as_sf(x = LOTVS_pts, coords = c("long", "lat"))
#Load biomes polygons
Biomes <- st_read("D:/WorldEcologicalLandUnits/TerEcorTNC/Diss_fx_tnc_ecor.shp")
## Reading layer `Diss_fx_tnc_ecor' from data source `D:\WorldEcologicalLandUnits\TerEcorTNC\Diss_fx_tnc_ecor.shp' using driver `ESRI Shapefile'
## Simple feature collection with 16 features and 16 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: -180 ymin: -89.9 xmax: 180 ymax: 83.6236
## geographic CRS: WGS 84
#Set CRS
st_crs(LOTVS_spatial) <- st_crs(Biomes)

#Select only some cols of biomes
Biomes <- Biomes[c("WWF_REALM", "WWF_MHTNAM")]

#Simplify biomes
Biomes_simplified <- rmapshaper::ms_simplify(input = Biomes)

#Remove Antarctic - need tmap for that
library(tmap)
data("World")
World_WGS <- st_transform(World, crs = 4326)
Biomes_simplified <- st_crop(Biomes_simplified, st_bbox(World_WGS[World_WGS$continent != "Antarctica", ])) #check warning

#compare sizes pre vs post simplify
object.size(Biomes); object.size(Biomes_simplified)
## 46906664 bytes
## 3673968 bytes
#Colours for biomes
palette_biomes <- c("Boreal Forests/Taiga" = "darkslategray3",
                    "Deserts and Xeric Shrublands" = "darkgoldenrod1",
                    "Flooded Grasslands and Savannas" = "darkorange",
                    "Inland Water" = "cyan",
                    "Mangroves" = "deeppink2",
                    "Mediterranean Forests, Woodlands and Scrub" = "darkorange3",
                    "Montane Grasslands and Shrublands" = "yellow",
                    "Rock and Ice" = "cornsilk",
                    "Temperate Broadleaf and Mixed Forests" = "darkolivegreen1",
                    "Temperate Conifer Forests" = "deepskyblue4",
                    "Temperate Grasslands, Savannas and Shrublands" = "darkkhaki",
                    "Tropical and Subtropical Coniferous Forests" = "burlywood3",
                    "Tropical and Subtropical Dry Broadleaf Forests" = "chartreuse4", #check here
                    "Tropical and Subtropical Grasslands, Savannas and Shrublands" = "darkorange4",
                    "Tropical and Subtropical Moist Broadleaf Forests" = "darkgreen",
                    "Tundra" = "azure")

palette_biomes.col <- unname(palette_biomes[Biomes_simplified$WWF_MHTNAM])

#Create color palette for categorical data
colors_biomes <- colorFactor(palette = palette_biomes.col, levels = Biomes_simplified$WWF_MHTNAM)

#make LOTVS icon
lotvsIcon <- makeIcon(
  iconUrl = "D:/LOTVS_map/LOTVS_off.png",
  iconWidth = 50, iconHeight = 50,
  iconAnchorX = 0, iconAnchorY = 0
)

#multiple layers can be assigned to the same group
#layerID are unique
LOTVS_database <- leaflet(data = Biomes_simplified) %>%
  addEsriBasemapLayer(esriBasemapLayers$Imagery, group = "ESRI-Imagery", autoLabels = F) %>%
  addEsriBasemapLayer(esriBasemapLayers$Streets, group = "ESRI-Streets") %>%
  addPolygons(color = ~colors_biomes(WWF_MHTNAM), stroke = FALSE,
              fillOpacity = 0.6, smoothFactor = 0.5, fillColor = 0,
              group = "Biomes") %>%
  addLegend(position = "bottomleft", pal = colors_biomes,
            values = Biomes_simplified$WWF_MHTNAM,
            title = "Biomes", group = "Biomes", opacity = 0.5) %>%
  addMarkers(lng = st_coordinates(LOTVS_spatial)[, 1], lat = st_coordinates(LOTVS_spatial)[, 2],
             clusterOptions = markerClusterOptions(),
             icon = lotvsIcon, group = "Dataset") %>%
  addLayersControl(baseGroups = c("ESRI-Imagery", "ESRI-Streets"),
                   overlayGroups = c("Biomes", "Dataset"),
                   position = "topright") %>%
  setView(lat = 39.466667, lng = -0.375000, zoom = 1)  %>%
  addMiniMap(width = 100, height = 80) %>%
  addFullscreenControl() %>%
  addResetMapButton()

#save map
#save_html(LOTVS_database, "LOTVS.html")

#saveWidget(LOTVS_database, "LOTVS_wdgt.html")

CLICK THE FULL SCREEN BOTTON AT THE TOP-LEFT OF THE MAP WINDOW FOR FULL-SCREEN VIEW

#show map
LOTVS_database

The map of the biomes was downloaded from https://rmgsc.cr.usgs.gov/outgoing/ecosystems/Global/ (accessed on January 11th, 2021).